//
//  HSYCustomBaseTableViewMoveCell.h
//  高仿暴走斗图
//
//  Created by key on 16/3/29.
//  Copyright © 2016年 huangsongyao. All rights reserved.
//

#import "HSYBaseTableViewCell.h"
#import "HSYSlideView.h"

typedef NS_ENUM(NSUInteger, kSlideCellRevealDirectionType) {
    
    kSlideCellRevealDirectionTypeNone           = 0,       //不开启手势
    kSlideCellRevealDirectionTypeBoth           = 1,       //支持左右两个方向的平移
    kSlideCellRevealDirectionTypeRight          = 2,       //只支持向右的平移
    kSlideCellRevealDirectionTypeLeft           = 3,       //只支持向左的平移
};

typedef NS_ENUM(NSUInteger, kCellGestureStatusType) {
    
    kCellGestureStatusTypeShouldOpen            = 0,       //将要平移
    kCellGestureStatusTypeEndOpen               = 1,       //平移结束
    kCellGestureStatusTypeShouldClose           = 2,       //将要关闭平移
    kCellGestureStatusTypeEndClose              = 3,       //关闭平移结束
    
};

@class HSYCustomBaseTableViewMoveCell;
@protocol HSYCustomBaseTableViewMoveCellDelegate <NSObject>

- (void)didCellMoveForGestureStatus:(kCellGestureStatusType)gestrueStatus withObject:(HSYCustomBaseTableViewMoveCell *)cell;

@optional

- (void)sendSelectDeleteForCell:(id)cell;
- (void)sendSelectCancel;

@end

@interface HSYCustomBaseTableViewMoveCell : HSYBaseTableViewCell<UIGestureRecognizerDelegate>

@property (nonatomic, assign, readonly) CGFloat slidingWith;                                  //用于统一滑块的距离
@property (nonatomic, readwrite) kSlideCellRevealDirectionType directionType;       //是否开启手势，默认为不开启
@property (nonatomic, weak) id<HSYCustomBaseTableViewMoveCellDelegate>delegate;

/**
 *  添加滑动手势
 *
 *  @param view 添加的视图
 */
- (void)addPanGestureRecognizerInView:(UIView *)view;

/**
 *  移除滑动手势
 *
 *  @param view 手势添加的视图
 */
- (void)removePanGestureRecognizerForView:(UIView *)view;

/**
 *  关闭滑块
 *
 *  @param isAnimated 是否执行动画
 */
- (void)closeMoveCellWithAnimated:(BOOL)isAnimated;

@end
